<?php
include_once("../inc/conn.php"); 
include_once("../inc/escape.php"); 
include_once("../inc/get_joke_url.php");
include_once("../inc/get_attitude.php");
include_once("comment_page.php");

$joke_url=$_POST["url"];
//$joke_url=substr($joke_url,1,strlen($joke_url));

$sql="select * from joke where url='".$joke_url."'";

$row=mysql_fetch_array(mysql_query($sql));

$tagresult = mysql_query("select * from joke_tag where joke_id='".$row["id"]."'");
$tagstr="";
while($tagrow = mysql_fetch_array($tagresult))
{
	$tagstr.=$tagrow["tag_name"].",";
}
$tagstr=substr($tagstr,0,strlen($tagstr)-1);

$next_joke_url=get_joke_url($joke_url);



$re_str=$next_joke_url."|".$row["author"]."|".$row["pubtime"]."|".$tagstr."|".$row["title"]."|"."<pre>".$row["content"]."</pre>"."|".$row["id"]."|".comment_page(1,$row["id"])."|".get_attitude($row["id"]);
echo escape($re_str);
?>
